<template>
  <div>
     <div class="config">
        <div class="back" onclick="window.history.go(-1)"><img src="../assets/images/back.png" alt=""></div>
        <p>邀请好友</p>
    </div>
    <div class="header">
        <p class="title">邀请好友人数</p>
        <p class="money">{{num}}<span>人</span></p>
    
        
    </div>
      <div class="box"> 
        <router-link to="/agentDetail">          
            <div class="row">             
                <p>邀请代理明细</p>
                <img src="../assets/images/gd.png" alt="" class="gengduo">
            </div> 
        </router-link>
        <router-link to="/inviteAgent">
            <div class="row">             
                <p>邀请代理</p>
                <img src="../assets/images/gd.png" alt="" class="gengduo">    
            </div> 
        </router-link>
        <!-- <div class="invite">
            <p>我的邀请码:</p>
            <p><span>WA5QX </span>(点击复制)</p>
        </div>  -->
     </div>
 


  </div>
</template>

<script>
export default {
    name: "personal",
    data() {
        return {
            num:""
        };
    },
    beforeCreate() {
        document.getElementsByTagName("body")[0].style.background = "#ececec";
    },
    mounted(){
        // 邀请好友人数
        var qs=require("qs");
        this.axios({
            method: "post",
            url: `${this.siteUrl}/getInvitationCount`,
            data:  qs.stringify({
             
                    uid: localStorage.getItem("uid")
                })
        })
            .then(response => {
            
                if ((response.data.result == 200)) {
                    this.num=response.data.data;
                } else {
                    alert("请求失败");
                }
            })
            .catch(function(error) {
                console.log(error);
            });
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.header{
    height: 200px;
    background: #5aa0c8;
    position: relative;
    color: #fff;
    z-index:-1;
}
.header .title{
   position: absolute;
   left: 20px;
   top:40px;
    
}
.header .money{
   position: absolute;
   left: 20px;
   top:70px;
   font-size: 40px;
    
}
.header span {
    margin-left: 5px;
    font-size: 12px;
}
.box {
    width: 94%;
    margin-left: 3%;
    border-radius: 3px;
    background: #fff;
    margin-top: -40px;
    overflow: hidden;
    padding-bottom: 20px;
    font-size: 14px;
   
}

.row {
    height: 50px;
    line-height: 50px;
    background: #fff;
    border-bottom: 1px solid #f2f2f2;
    margin: 8px;
    font-size: 14px;
    position: relative;
}
.row .gengduo {
    position: absolute;
    height: 12px;
    top: 19px;
    right: 5px;
}
.invite{
    margin-left: 8px;
    
}
.invite p{
    height: 30px;
   line-height: 30px
}
.invite p:last-child{
    font-size: 16px;
}
.invite span{
    color: #5aa0c8
}




</style>
